package com.modificial.springboot.user;

import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collections;
import java.util.List;

/**
 * @author modificial
 * @data 2018/12/3
 * @since 8:38
 */
@RestController
@RequestMapping("/user")
public class UserController {
    /**
     * 返回json字符串
     *
     * @return
     */
    @GetMapping("/listUsers")
    public List<SecurityProperties.User> listUsers() {

        SecurityProperties.User user = new SecurityProperties.User();
        user.setName("modificial");
        user.setPassword("123456");
        user.setRoles(Collections.singletonList("admin"));
        return Collections.singletonList(user);
    }
}
